SUBROUTINE readjanaf(spc,temp,thp)

	IMPLICIT NONE	
	CHARACTER(8) :: spc
	REAL :: temp,thp(6)

	INTEGER :: io,i,j
	REAL :: txx,txxo,xx,prop(6)
	CHARACTER(8) :: tzz

!	write(tzz,'(A8)') spc
	open(unit=10,file=''//spc//'')

	io=0
	i=0
	DO
	i=i+1
	IF(io.gt.0) THEN
	write(*,*) 'Given temp is over the maximum temp from JANAF!!'
	EXIT
	ENDIF
	if(i.le.3) then
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! To skip unnecessary text in the 1st part of file !!
	read(10,*,IOSTAT=io) tzz
!! End of skipping part                             !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	else
	txxo=txx
	thp=prop
	read(10,*,IOSTAT=io) txx,(prop(j),j=1,6)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! Interpolation of thermo properties !!
	IF(txx.ge.temp) THEN
	xx=(temp-txxo)/(txx-txxo)
	thp=thp+xx*(prop-thp)
	EXIT
	ENDIF
!! End of Interpolation               !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	endif
	ENDDO
   20	write(*,*) 'NORMAL TERMINATION OF READJANAF ROUTINE'
	close(10)
	RETURN
  100	format(A8)
END SUBROUTINE readjanaf
